package thread.safe;

import java.util.List;

public class WriteThread implements Runnable {

    /**
     * 如果在这里不实例化，会报UnsupportedOperationException
     */
    private List<Integer> list;

    public WriteThread(List<Integer> list) {
        this.list = list;
    }

    @Override public void run() {
        this.list.add(9);
    }
}
